import { createRouter, createWebHashHistory } from "vue-router";

const routes = [
  // 重定向
  {
    path: "/",
    redirect: "/Home/first",
  },
  {
    path: "/home",
    component: () => import("../views/Home.vue"),
    children: [
      {
        path: "/home/first",
        component: () => import("../views/Home/First.vue"),
      },
      {
        path: "/home/class",
        component: () => import("../views/Home/Class.vue"),
      },
      {
        path: "/home/shopping",
        component: () => import("../views/Home/Shopping.vue"),
      },
      {
        path: "/home/mine",
        component: () => import("../views/Home/Mine.vue"),
        meta:{
          loginmes:false,
        }
      },
    ],
  },
  {
    path: "/address",
    component: () => import("../views/Address.vue"),
  },
  {
    path: "/newAddress",
    component: () => import("../views/newAddress.vue"),
  },
  {
    path: "/detail",
    component: () => import("../views/Detail.vue"),
  },
  {
    path: "/login",
    component: () => import("../views/Login.vue"),
  },
  {
    path: "/member",
    component: () => import("../views/Member.vue"),
  },
  {
    path: "/404",
    component: () => import("../views/Not.vue"),
  },
  {
    path: "/:pathMatch(.*)",
    redirect: "/404",
  },
];

const router = createRouter({
  history: createWebHashHistory(),
  routes,
});

export default router;
